const api = require('../../api/api.js');
const app = getApp();

Page({
  data: {
    imgUrl: app.globalData.imgUrl + 'userImage/'
  },
  onLoad(o) {
    let account = o.account;
    this.setData({
      account
    });
    this.queryAccountData(account);
  },
  queryAccountData(account) {
    let that = this;
    api.queryAccountData({
      data: {
        account
      },
      success(res) {
        console.log(res.data);
        let user = res.data.accountInfo;
        user.image = that.data.imgUrl + user.image
        that.setData({
          user
        });
      }
    });
  }
})